//
//  BookManager.m
//  03-homework
//
//  Created by dllo on 16/7/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BookManager.h"

@implementation BookManager
- (void)changeBookPrice:(NSString *)name price:(float)price{
    for (Book *book in self.books) {
        if ([book.bookName isEqualToString:name]) {
            book.price = price;
        }
    }
}
- (void)showAllBookNames{
    for (Book *book in self.books) {
        NSLog(@"%@", book.bookName);
    }
}
- (void)showAllBookInformation{
    for (Book *book in self.books) {
        NSLog(@"书名:%@  价格:%lf", book.bookName, book.price);
    }
}
- (void)searchBookFromName:(NSString *)name{

    for (Book *book in self.books) {
        [book.bookName isEqualToString:name];
        NSLog(@"该书的详细信息,书名:%@ 价格:%f", book.bookName, book.price);
    }
}
- (void)deleteAllBook{
    for (Book *book in self.books) {
        book.bookName = nil;
        book.price = 0;
    }
}
@end
